package com.hk.urils;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class PropertiesUtil {


    /**
     * 从指定目录获取配置参数
     * @param propertiesPath
     * @return
     */
    public static Properties getProperties(String propertiesPath){

        Properties properties = new Properties();
        try {
//            InputStream inputStream = PropertiesUtils.class.getClassLoader().getResourceAsStream(propertiesPath);
            // 读取全路径的配置文件
//            BufferedReader bufferedReader = new BufferedReader(new FileReader(propertiesPath));
            BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(propertiesPath));
            properties.load(bufferedInputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties;
    }

}
